<?php
namespace App\Http\Service\Product;


use App\Http\Service\Basic\BasicService;
use Config;

class ProductService extends BasicService
{

    //构造函数
    function __construct()
    {
        parent::__construct();
    }


    //一级代理列表
    public function getProductList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.product_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }


    // 代理账号修改
    public function doProductUpdate($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.Agentupdate'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.product_update'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    /**
     * 代理信息删除
     */
    public function doProductDelete($where)
    {
//                dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.Agent_delete'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.product_del'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }


    //添加代理
    public function doProductAdd($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.product_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }




}